package com.example.controller;

import com.example.pojo.Result;
import com.example.pojo.queryResult;
import com.example.service.engineDataQueryService;
import com.example.service.tMesProMaterialService;
import com.example.service.tMesProStationDataService;
import com.example.service.tMesTileChooseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
import java.util.Map;

@RestController
public class engineDataQueryController{
    @Autowired
    private engineDataQueryService engineDataQueryService;

    @Autowired
    private tMesProMaterialService tMesProMaterialService;

    @Autowired
    private tMesTileChooseService tMesTileChooseService;
    @Autowired
    private tMesProStationDataService tMesProStationDataService;



    //查询所有符合条件的数据并返回，连接前端页面发送的地址，EngineDataQuery 这个是前端页面名对应，EngineDataQuery 后端数据库名对应
    @PostMapping("/queryMultipleConditionsEngineDataQuery")
    public Result queryMultipleConditionsEngineDataQuery(@RequestBody Map<String, Object> map) {
        //调用service层函数
        queryResult pojoList = engineDataQueryService.queryMultipleConditions(map);
        return Result.success(pojoList);
    }

    //查询所有符合条件的物料数据并返回，连接前端页面发送的地址，EngineDataQuery 这个是前端页面名对应，tMesProMaterial 后端数据库名对应
    @PostMapping("/queryMaterialEngineDataQuery")
    public Result queryMaterialEngineDataQuery(@RequestBody Map<String, Object> map) {
        //调用service层函数
        queryResult pojoList = tMesProMaterialService.queryMaterial(map);
        return Result.success(pojoList);
    }

    //查询所有符合条件的选瓦数据并返回，连接前端页面发送的地址，EngineDataQuery 这个是前端页面名对应，tMesTileChoose 后端数据库名对应
    @PostMapping("/queryChooseEngineDataQuery")
    public Result queryChooseEngineDataQuery(@RequestBody Map<String, Object> map) {
        //调用service层函数
        queryResult pojoList = tMesTileChooseService.queryChoose(map);
        return Result.success(pojoList);
    }
    //查询所有符合条件的过站数据并返回，连接前端页面发送的地址，EngineDataQuery 这个是前端页面名对应，tMesProStationData 后端数据库名对应
    @PostMapping("/queryStationEngineDataQuery")
    public Result queryStationEngineDataQuery(@RequestBody Map<String, Object> map) {
        //调用service层函数
        queryResult pojoList = tMesProStationDataService.queryStation(map);
        return Result.success(pojoList);
    }

}
